raw_species_ver2 <- correctTaxo(genus = raw_species_ver2$genus, species = raw_species_ver2$species, useCache = TRUE)
View(raw_species_ver2)
raw_species_ver2 <- read.csv("~/Desktop/Project/sp_list_corrected_ver2.csv", header = TRUE)
raw_species_corrected <- correctTaxo(genus = raw_species_ver2$genus, species = raw_species_ver2$species, useCache = TRUE)
View(sp_list_corrected_ver2)
View(raw_species_corrected)
raw_species_corrected <- raw_species_ver2 %>% mutate(speciesnames)
raw_species_corrected <- left_join(raw_species_corrected, raw_species_ver2)
library(dplyr)
raw_species_corrected <- left_join(raw_species_corrected, raw_species_ver2)
colnames(raw_species_corrected) <- c(genusCorr, speciesCorr, nameModified)
colnames(raw_species_corrected) <- c("genusCorr, speciesCorr, nameModified")
colnames(raw_species_corrected) <- c("genusCorr", "speciesCorr", "nameModified")
raw_species_corrected <- left_join(raw_species_corrected, raw_species_ver2, by = "genusCorr")
raw_species_corrected <- left_join(raw_species_corrected, raw_species_ver2, by = c("genusCorr", "speciesCorr")
raw_species_corrected <- left_join(raw_species_corrected, raw_species_ver2, by = c("genusCorr", "speciesCorr"))
library(dplyr)
raw_species_corrected <- left_join(raw_species_corrected, raw_species_ver2, by = c("genusCorr", "speciesCorr"))
raw_species_ver2 <- read.csv("~/Desktop/Project/sp_list_corrected_ver2.csv", header = TRUE)
raw_species_corrected <- correctTaxo(genus = raw_species_ver2$genus, species = raw_species_ver2$species, useCache = TRUE)
colnames(raw_species_corrected) <- c("genusCorr", "speciesCorr", "nameModified")
raw_species_corrected <- left_join(raw_species_corrected, raw_species_ver2, by = c("genusCorr", "speciesCorr"))
try <- filter(raw_species_corrected$nameModified != "FALSE")
try <- filter(raw_species_corrected, nameModified != "FALSE")
View(try)
write.csv("~/Desktop", file = "corrected_names_comparison.csv")
write.csv("~/Desktop/", file = "corrected_names_comparison.csv")
write.csv(try, "~/Desktop/corrected_names_comparison.csv")
install.packages("Taxize")
install.packages("taxize")
library(taxize)
help(taxize)
mytree <- ape::read.tree("~/Downloads/tree-of-trees-master/trees/angiosperms_apg2009.new")
View(mytree)
plot(mytree)
Xplorefiles(from = "HOME", recursive = TRUE, ignore.case = TRUE)
editFileExtensions()
quit()
library(dplyr)
library(readr)
sp_list_corrected_ver2_Only_Names_and_genes <- read_csv("Downloads/sp_list_corrected_ver2 - Only Names and genes.csv")
View(sp_list_corrected_ver2_Only_Names_and_genes)
library(dplyr)
install.packages("dplyr")
library(dplyr)
View(sp_list_corrected_ver2_Only_Names_and_genes)
library(readxl)
bdj_08_e39677_s001 <- read_excel("Desktop/bdj-08-e39677-s001.xlsx")
View(bdj_08_e39677_s001)
colnames(bdj_08_e39677_s001)[5] <- 'matk'
colnames(bdj_08_e39677_s001)[6] <- 'rbcL'
bdj_combined <- right_join(sp_list_corrected_ver2_Only_Names_and_genes, bdj_08_e39677_s001, by = c('matk', 'rbcL'))
View(bdj_combined)
colnames(bdj_08_e39677_s001)[1] <- 'speciesnames'
bdj_08_e39677_s001 <- filter(bdj_08_e39677_s001, c('speciesnames', 'matk', "rbcL"))
bdj_08_e39677_s001 <- filter(bdj_08_e39677_s001, 'speciesnames', 'matk', "rbcL")
bdj_08_e39677_s001 <- filter(bdj_08_e39677_s001, speciesnames, matk, rbcL)
bdj_08_e39677_s001 <- select(bdj_08_e39677_s001, speciesnames, matk, rbcL)
bdj_combined <- right_join(sp_list_corrected_ver2_Only_Names_and_genes, bdj_08_e39677_s001, by = c('matk', 'rbcL'))
bdj_combined <- left_join(sp_list_corrected_ver2_Only_Names_and_genes, bdj_08_e39677_s001, by = c('matk', 'rbcL'))
bdj_combined <- left_join(sp_list_corrected_ver2_Only_Names_and_genes, bdj_08_e39677_s001, by = c('speciesnames', 'matk', 'rbcL'))
bdj_combined <- inner_join(sp_list_corrected_ver2_Only_Names_and_genes, bdj_08_e39677_s001, by = 'speciesnames')
bdj_inner <- inner_join(sp_list_corrected_ver2_Only_Names_and_genes, bdj_08_e39677_s001, by = 'speciesnames')
write.csv(bdj_inner, "~/Desktop/bdj_inner_join.csv")
library(tidyverse)
library(dplyr)
library(readr)
gbif_species_name_9Feb <- read_csv("Desktop/gbif_species_name_9Feb.csv")
View(gbif_species_name_9Feb)
gbif_species_name_9Feb %>% unique(species)
gbif_species_name_9Feb_unique <- unique(gbif_species_name_9Feb$species)
rm(gbif_species_name_9Feb_unique)
gbif_9Feb <- gbif_species_name_9Feb[!duplicated(gbif_species_name_9Feb$species)]
gbif_9Feb <- distinct(gbif_species_name_9Feb$species)
gbif_species_name_9Feb %>% distinct(gbif_species_name_9Feb$species)
new_gbif <- gbif_species_name_9Feb %>% distinct(gbif_species_name_9Feb$species)
View(new_gbif)
rm(new_gbif)
rm(gbif_species_name_9Feb)
install.packages("BIOMASS")
library(BIOMASS)
help(BIOMASS)
library(readr)
splist <- read_csv("Desktop/splist.csv",
col_names = FALSE)
View(splist)
`colnames(splist) <- "species_names"
`colnames(splist) <- c("species_names")
`colnames(splist) <- c("species_names")
colnames(splist) <- c("species_names")
q
xcdcd
q
(quit)
quit
colnames(splist) <- c("species_names")
splist <- splist %>% mutate(splist, species_names_copy = species_names)
splist <- mutate(splist, species_names_copy = species_names)
splist <- mutate(splist, species_names_copy = species_names)
library(dplyr)
splist <- mutate(splist, species_names_copy = species_names)
splist <- splist %>% mutate(., species_names_copy = species_names) %>%
separate(., species_names_copy, c("genus", "species"))
library(tidyr)
install.packages("tidyr")
install.packages("tidyr")
library(tidyr)
splist <- splist %>% mutate(., species_names_copy = species_names) %>%
separate(., species_names_copy, c("genus", "species"))
library(dplyr)
splist <- splist %>% mutate(., species_names_copy = species_names) %>%
separate(., species_names_copy, c("genus", "species"))
splist <- splist %>% mutate(., species_names_copy = species_names) %>%
separate(., species_names_copy, c("genus", "species"))
splist <- splist %>% mutate(., species_names_copy = species_names) %>%
separate(., species_names_copy, c("genus", "species"), by "_")
splist <- splist %>% mutate(., species_names_copy = species_names) %>%
separate(., species_names_copy, c("genus", "species"), by "_"))
splist <- splist %>% mutate(., species_names_copy = species_names) %>%
separate(., species_names_copy, c("genus", "species"), by "_")
splist <- splist %>% mutate(., species_names_copy = species_names) %>%
separate(., species_names_copy, c("genus", "species"), by = "_")
splist <- splist %>% mutate(., species_names_copy = species_names) %>%
separate(., species_names_copy, c("genus", "species"), sep = "_")
splist <- splist %>% mutate(., species_names_copy = species_names) %>%
separate(., col = species_names_copy, into = c("genus", "species"), sep = "_")
read.csv("~/Desktop/needs_correction.csv", header = TRUE)
needs_correction <- read.csv("~/Desktop/needs_correction.csv", header = TRUE)
library(APE)
library(ape)
library(BIOMASS)
View(needs_correction)
needs_correction <- read.csv("~/Desktop/needs_correction.csv", header = TRUE)
library(dplyr)
createCache()
corrected <- correctTaxo(genus = needs_correction$genus, species = needs_correction$species, useCache = TRUE)
install.packages("httr")
library(httr)
corrected <- correctTaxo(genus = needs_correction$genus, species = needs_correction$species, useCache = TRUE)
View(corrected)
write.csv(corrected, "~/Desktop/corrected.csv")
read.csv("~/Desktop/7k_species_file.csv")
previous <- read.csv("~/Desktop/7k_species_file.csv")
joined <- left.join(corrected, previous, by = "species_names")
library(dplyr)
joined <- left.join(corrected, previous, by = "species_names")
joined <- left_join(corrected, previous, by = "species_names")
View(previous)
View(corrected)
corrected <- mutate(corrected, species_names = genusCorrected, speciesCorrected)
corrected <- mutate(corrected, species_names = genusCorrected + speciesCorrected)
corrected <- unite(corrected, genusCorrected, speciesCorrected, sep = " ")
library(tidyr)
corrected <- unite(corrected, genusCorrected, speciesCorrected, sep = " ")
needs_correction <- read.csv("~/Desktop/needs_correction.csv", header = TRUE)
corrected <- correctTaxo(genus = needs_correction$genus, species = needs_correction$species, useCache = TRUE)
write.csv(corrected, "~/Desktop/corrected.csv")
species_list_final <- read.csv("~/Desktop/species_list_final")
species_list_final <- read.csv("~/Desktop/species_list_final.csv")
View(species_list_final)
joined <- left_join(species_list_final, previous, by = "species_names")
species_list_final <- read.csv("~/Desktop/species_list_final.csv")
previous <- read.csv("~/Desktop/7k_species_file.csv")
joined <- left_join(species_list_final, previous, by = "species_names")
joined <- left_join(species_list_final, previous, by = "speciesnames")
View(species_list_final)
species_list_final <- read.csv("~/Desktop/species_list_final.csv")
previous <- read.csv("~/Desktop/7k_species_file.csv")
joined <- left_join(species_list_final, previous, by = "speciesnames")
View(species_list_final)
View(joined)
write.csv(joined, "~/Desktp/combined_species_list_final")
write.csv(joined, "~/Desktp/combined_species_list_final.csv")
View(joined)
write.csv(joined, "~/Desktop/combined_species_list_final.csv")
species_list_final <- read.csv("~/Desktop/species_list_final.csv")
previous <- read.csv("~/Desktop/7k_species_file.csv")
joined <- left_join(species_list_final, previous, by = "speciesnames")
write.csv(joined, "~/Desktop/combined_species_list_final.csv")
View(joined)
previous <- read.csv("~/Desktop/7k_species_file.csv")
joined <- left_join(species_list_final, previous, by = "speciesnames")
View(joined)
View(previous)
write.csv(joined, "~/Desktop/combined_species_list_final.csv")
read.csv("~/Desktop/semini_species.csv")
semini_species <- read.csv("~/Desktop/semini_species.csv")
library(ape)
library(BIOMASS)
library(dplyr)
library(tidyr)
library(httr)
createCache()
all_combined <-full_join(joined, semini_species, by= c("speciesnames", "matk", "rbcL", "its1", "its2"))
View(species_list_final)
View(all_combined)
all_combined <-full_join(joined, semini_species, by= c("speciesnames", "matk","trnh_psba", "rbcL", "its1", "its2"))
write.csv(all_combined, "~/Desktop/final_dataset.csv ")
write.csv(all_combined, "~/Desktop/final_dataset.csv")
View(corrected)
View(joined)
View(semini_species)
library(ape)
library(BIOMASS)
createCache()
library(taxize)
createCache()
new_temp2 <- correctedTaxo(genus = temp$genus, species = temp$species, useCache = TRUE)
library(BIOMASS)
library(ape)
library(dplyr)
library(tidyr)
library(httr)
help(BIOMASS)
library(BIOMASS)
new_temp2 <- correctedTaxo(genus = temp$genus, species = temp$species, useCache = TRUE)
new_temp2 <- correctTaxo(genus = temp$genus, species = temp$species, useCache = TRUE)
temp <- read.csv("~/Downloads/final_dataset.csv")
new_temp2 <- correctTaxo(genus = temp$genus, species = temp$species, useCache = TRUE)
library(ape)
library(taxize)
library(BIOMASS)
library(taxonomizr)
library(dplyr)
temp <- read.csv("~/Downloads/final_dataset.csv")
new_temp2 <- correctTaxo(genus = temp$genus, species = temp$species, useCache = TRUE)
View(new_temp2)
View(temp)
rm(new_temp2)
rm(new_temp)
#getting the taxonomy of the genus from BIOMASS - getTaxonomy
new_temp <- getTaxonomy(genus = temp$genus, findOrder = TRUE)
library(BIOMASS)
#getting the taxonomy of the genus from BIOMASS - getTaxonomy
new_temp <- getTaxonomy(genus = temp$genus, findOrder = TRUE)
library(ape)
library(ape)
library(taxize)
library(BIOMASS)
#getting the taxonomy of the genus from BIOMASS - getTaxonomy
new_temp <- getTaxonomy(genus = temp$genus, findOrder = TRUE)
View(new_temp)
temp$X <- new_temp$family
View(temp)
temp <- mutate(temp, "order")
library(dplyr)
temp <- mutate(temp, "order")
temp$order <- new_temp$order
temp <- read.csv("~/Downloads/final_dataset.csv")
new_temp[1] <- "genus"
#getting the taxonomy of the genus from BIOMASS - getTaxonomy
new_temp <- getTaxonomy(genus = temp$genus, findOrder = TRUE)
colnames(new_temp) <- c("genus", "family", "order")
temp <- left_join(temp, new_temp, by = "genus")
write.csv(new_temp, "~/Desktop/file_for_grdip.csv")
write.csv(temp, "~/Desktop/file_for_grdip.csv")
### How will I know which one is the accepted name in the taxonomy using this?
library(taxize)
# Example dataframe containing plant names
df <- data.frame(plant_name = c("Acer rubrum", "Abies concolor", "Quercus alba", "Pinus ponderosa"))
# Apply get_accepted_names() to the plant_name column
df$accepted_name <- sapply(df$plant_name, get_accepted_names)
# View the updated dataframe
df
### How will I know which one is the accepted name in the taxonomy using this?
library(taxize)
# Example dataframe containing plant names
df <- data.frame(plant_name = c("Acer rubrum", "Abies concolor", "Quercus alba", "Pinus ponderosa"))
# Apply get_accepted_names() to the plant_name column
df$accepted_name <- sapply(df$plant_name, get_accepted_names)
# View the updated dataframe
df
### How will I know which one is the accepted name in the taxonomy using this?
library(taxize)
# Apply get_accepted_names() to the plant_name column
df$accepted_name <- sapply(df$plant_name, get_accepted_names)
library(ape)
library(dplyr)
library(BIOMASS)
# Apply get_accepted_names() to the plant_name column
df$accepted_name <- sapply(df$plant_name, get_accepted_names)
library(poweR)
# Example list of plant species
species_list <- c("Acer rubrum", "Abies concolor", "Quercus alba", "Pinus ponderosa")
# Initialize the POWO client
pwo_client <- powo_client()
library(poweR)
### Can I get the accepted names of the plant species from a database named "powo" using any R package ?
install.packages("poweR")
library(poweR)
### Can I get the accepted names of the plant species from a database named "powo" using any R package ?
install.packages("powo")
#U.Taxonstand
install.packages("U.Taxonstand")
install.packages("powo")
install.packages("poweR")
install.packages("devtools")
devtools::install_github("barnabywalker/kewr")
download_wcvp()
load_tol()
devtools::install_github("barnabywalker/kewr")
force = TRUE
devtools::install_github("barnabywalker/kewr")
devtools::install_github("barnabywalker/kewr", force = TRUE)
rm(force)
download_wcvp()
lookup_powo("320035-2")
lookup_ipni("987-2", type="publication")
library(poweR)
### Can I get the accepted names of the plant species from a database named "powo" using any R package ?
install.packages("poweR")
library(taxizedb)
june <- read.csv('june.csv', header = TRUE)
t <- tax_name(query = c(june$speciesnames), get = c("phylum","class", "order", "family", "genus"), db = "ncbi", use_entrez())
## Can I also resolve the same for mis-spellings or typos?
# Yes, you can use the correct_names() function from the taxize package to correct misspelled or typo-ridden plant names before using the get_accepted_names() function to obtain the accepted names.
library(taxize)
t <- tax_name(query = c(june$speciesnames), get = c("phylum","class", "order", "family", "genus"), db = "ncbi", use_entrez())
t <- tax_name(query = c(june$speciesnames), get = c("phylum","class", "order", "family", "genus"), db = "ipni", use_entrez())
t <- tax_name(query = c(june$speciesnames), get = c("order", "family", "genus"), db = "ipni")
t <- tax_name(query = c(june$speciesnames), get = c("order", "family", "genus"), db = "ipni")
library(BIOMASS)
june <- read.csv("~/Desktop/jun", header = TRUE)
june <- read.csv("~/Desktop/jun.csv", header = TRUE)
june <- read.csv("~/Desktop/jun.xlsx", header = TRUE)
june <- read.csv("~/Desktop/jun.csv", header = TRUE)
View(june)
june_taxanomy_dataset <- getTaxonomy(june$genus, findOrder =  TRUE)
View(june_taxanomy_dataset)
june_taxanomy_dataset <- getTaxonomy(june$genus)
View(june_taxanomy_dataset)
ndOrder =  TRUE
View(june_taxanomy_dataset)
june_taxanomy_dataset <- getTaxonomy(june$genus)
View(june_taxanomy_dataset)
june_taxanomy_dataset <- getTaxonomy(june$genus, findOrder = TRUE)
View(june_taxanomy_dataset)
write.csv(june_taxanomy_dataset, "~/Desktop/june_taxa.csv")
#install.packages("seqinr")
#install.packages("ape")
# install.packages("tidyverse")
# install.packages("readxl")
library(seqinr)
library(ape)
# library(dplyr)
library(tidyverse)
library(xlsx)
library(ape)x
library(ape)
library(BIOMASS)
library(dplyr)
library(tidyr)
library(httr)
createCache()
library(readr)
rbcL_sequences_final_matk_sequences_10_alignment_2 <- read_csv("Desktop/rbcL_sequences_final - matk_sequences_10 alignment 2.csv")
View(rbcL_sequences_final_matk_sequences_10_alignment_2)
library(readr)
rbcL_matK_names <- read_csv("Desktop/rbcL_sequences_final - matk_sequences_10 alignment 2.csv")
View(rbcL_matK_names)
rm(rbcL_sequences_final_matk_sequences_10_alignment_2)
taxonomy_1 <- getTaxonomy(genus = rbcL_matK_names$genus, findOrder = TRUE)
View(taxonomy_1)
write.csv(taxonomy_1, "~/Desktop/rbcL_matk_constraints", header = TRUE)
write.csv(taxonomy_1, "~/Desktop/rbcL_matk_constraints")
write.csv(taxonomy_1, "~/Desktop/rbcL_matk_constraints.csv")
install.packages("V.PhyloMaker")
install.packages("V.PhyloMaker2")
setwd(dir ="~/Desktop/Order-Wise trees/Apiales")
library(seqinr)
library(ape)
Apiales_rbcL <- read.csv("Apiales_rbcL.csv")
Apiales_rbcL_genbank_rbcL <- read.GenBank(Apiales_rbcL$rbcL)
write.dna(Apiales_rbcL_genbank_rbcL, file = "Apiales_rbcL.fasta", format = "fasta", append = FALSE)
Apiales_rbcL_seqinr <- read.fasta(file = "Apiales_rbcL.fasta", seqtype = "DNA", as.string = TRUE, forceDNAtolower = FALSE)
write.fasta(sequences = Apiales_rbcL_seqinr, names = Apiales_rbcL$speciesname, file.out = "Apiales_rbcL_sequences.fasta")
Apiales_matK <- read.csv("Apiales_matK.csv")
Apiales_matK_genbank_matK <- read.GenBank(Apiales_matK$matk)
write.dna(Apiales_matK_genbank_matK, file = "Apiales_matK.fasta", format = "fasta", append = FALSE)
Apiales_matK_seqinr <- read.fasta(file = "Apiales_matK.fasta", seqtype = "DNA", as.string = TRUE, forceDNAtolower = FALSE)
write.fasta(sequences = Apiales_matK_seqinr, names = Apiales_matK$speciesname, file.out = "Apiales_matK_sequences.fasta")
Apiales_trnH <- read.csv("Apiales_trnH.csv")
Apiales_trnH_genbank_trnH <- read.GenBank(Apiales_trnH$trnh_psba)
write.dna(Apiales_trnH_genbank_trnH, file = "Apiales_trnH.fasta", format = "fasta", append = FALSE)
Apiales_trnH_seqinr <- read.fasta(file = "Apiales_trnH.fasta", seqtype = "DNA", as.string = TRUE, forceDNAtolower = FALSE)
write.fasta(sequences = Apiales_trnH_seqinr, names = Apiales_trnH$speciesname, file.out = "Apiales_trnH_sequences.fasta")
Apiales_rbcL <- read.csv("Apiales_rbcL.csv")
Apiales_rbcL_genbank_rbcL <- read.GenBank(Apiales_rbcL$rbcL)
write.dna(Apiales_rbcL_genbank_rbcL, file = "Apiales_rbcL.fasta", format = "fasta", append = FALSE)
Apiales_rbcL_seqinr <- read.fasta(file = "Apiales_rbcL.fasta", seqtype = "DNA", as.string = TRUE, forceDNAtolower = FALSE)
write.fasta(sequences = Apiales_rbcL_seqinr, names = Apiales_rbcL$speciesname, file.out = "Apiales_rbcL_sequences.fasta")
library(seqinr)
library(ape)
setwd(dir ="~/Desktop/Order-Wise trees/Aquifoliales")
Aquifoliales_rbcL <- read.csv("Aquifoliales_rbcL.csv")
Aquifoliales_rbcL_genbank_rbcL <- read.GenBank(Aquifoliales_rbcL$rbcL)
write.dna(Aquifoliales_rbcL_genbank_rbcL, file = "Aquifoliales_rbcL.fasta", format = "fasta", append = FALSE)
Aquifoliales_rbcL_seqinr <- read.fasta(file = "Aquifoliales_rbcL.fasta", seqtype = "DNA", as.string = TRUE, forceDNAtolower = FALSE)
write.fasta(sequences = Aquifoliales_rbcL_seqinr, names = Aquifoliales_rbcL$speciesname, file.out = "Aquifoliales_rbcL_sequences.fasta")
Aquifoliales_matK <- read.csv("Aquifoliales_matK.csv")
Aquifoliales_matK_genbank_matK <- read.GenBank(Aquifoliales_matK$matk)
write.dna(Aquifoliales_matK_genbank_matK, file = "Aquifoliales_matK.fasta", format = "fasta", append = FALSE)
Aquifoliales_matK_seqinr <- read.fasta(file = "Aquifoliales_matK.fasta", seqtype = "DNA", as.string = TRUE, forceDNAtolower = FALSE)
write.fasta(sequences = Aquifoliales_matK_seqinr, names = Aquifoliales_matK$speciesname, file.out = "Aquifoliales_matK_sequences.fasta")
Aquifoliales_trnH <- read.csv("Aquifoliales_trnH.csv")
Aquifoliales_trnH_genbank_trnH <- read.GenBank(Aquifoliales_trnH$trnh_psba)
write.dna(Aquifoliales_trnH_genbank_trnH, file = "Aquifoliales_trnH.fasta", format = "fasta", append = FALSE)
Aquifoliales_trnH_seqinr <- read.fasta(file = "Aquifoliales_trnH.fasta", seqtype = "DNA", as.string = TRUE, forceDNAtolower = FALSE)
write.fasta(sequences = Aquifoliales_trnH_seqinr, names = Aquifoliales_trnH$speciesname, file.out = "Aquifoliales_trnH_sequences.fasta")
library(seqinr)
library(ape)
setwd(dir ="~/Desktop/Order-Wise trees/Arecales")
Arecales_rbcL <- read.csv("Arecales_rbcL.csv")
Arecales_rbcL_genbank_rbcL <- read.GenBank(Arecales_rbcL$rbcL)
write.dna(Arecales_rbcL_genbank_rbcL, file = "Arecales_rbcL.fasta", format = "fasta", append = FALSE)
Arecales_rbcL_seqinr <- read.fasta(file = "Arecales_rbcL.fasta", seqtype = "DNA", as.string = TRUE, forceDNAtolower = FALSE)
write.fasta(sequences = Arecales_rbcL_seqinr, names = Arecales_rbcL$speciesname, file.out = "Arecales_rbcL_sequences.fasta")
Arecales_matK <- read.csv("Arecales_matK.csv")
Arecales_matK_genbank_matK <- read.GenBank(Arecales_matK$matk)
write.dna(Arecales_matK_genbank_matK, file = "Arecales_matK.fasta", format = "fasta", append = FALSE)
Arecales_matK_seqinr <- read.fasta(file = "Arecales_matK.fasta", seqtype = "DNA", as.string = TRUE, forceDNAtolower = FALSE)
write.fasta(sequences = Arecales_matK_seqinr, names = Arecales_matK$speciesname, file.out = "Arecales_matK_sequences.fasta")
Arecales_trnH <- read.csv("Arecales_trnH.csv")
Arecales_trnH_genbank_trnH <- read.GenBank(Arecales_trnH$trnh_psba)
write.dna(Arecales_trnH_genbank_trnH, file = "Arecales_trnH.fasta", format = "fasta", append = FALSE)
Arecales_trnH_seqinr <- read.fasta(file = "Arecales_trnH.fasta", seqtype = "DNA", as.string = TRUE, forceDNAtolower = FALSE)
write.fasta(sequences = Arecales_trnH_seqinr, names = Arecales_trnH$speciesname, file.out = "Arecales_trnH_sequences.fasta")
setwd(dir ="~/Desktop/Order-Wise trees/Asparagales")
Asparagales_rbcL <- read.csv("Asparagales_rbcL.csv")
Asparagales_rbcL_genbank_rbcL <- read.GenBank(Asparagales_rbcL$rbcL)
write.dna(Asparagales_rbcL_genbank_rbcL, file = "Asparagales_rbcL.fasta", format = "fasta", append = FALSE)
Asparagales_rbcL_seqinr <- read.fasta(file = "Asparagales_rbcL.fasta", seqtype = "DNA", as.string = TRUE, forceDNAtolower = FALSE)
write.fasta(sequences = Asparagales_rbcL_seqinr, names = Asparagales_rbcL$speciesname, file.out = "Asparagales_rbcL_sequences.fasta")
Asparagales_matK <- read.csv("Asparagales_matK.csv")
Asparagales_matK_genbank_matK <- read.GenBank(Asparagales_matK$matk)
write.dna(Asparagales_matK_genbank_matK, file = "Asparagales_matK.fasta", format = "fasta", append = FALSE)
Asparagales_matK_seqinr <- read.fasta(file = "Asparagales_matK.fasta", seqtype = "DNA", as.string = TRUE, forceDNAtolower = FALSE)
write.fasta(sequences = Asparagales_matK_seqinr, names = Asparagales_matK$speciesname, file.out = "Asparagales_matK_sequences.fasta")
Asparagales_trnH <- read.csv("Asparagales_trnH.csv")
Asparagales_trnH_genbank_trnH <- read.GenBank(Asparagales_trnH$trnh_psba)
write.dna(Asparagales_trnH_genbank_trnH, file = "Asparagales_trnH.fasta", format = "fasta", append = FALSE)
Asparagales_trnH_seqinr <- read.fasta(file = "Asparagales_trnH.fasta", seqtype = "DNA", as.string = TRUE, forceDNAtolower = FALSE)
write.fasta(sequences = Asparagales_trnH_seqinr, names = Asparagales_trnH$speciesname, file.out = "Asparagales_trnH_sequences.fasta")
library(seqinr)
library(ape)
# reading sequences from file
setwd(dir ="~/Desktop/Files")
rbcL_num <- read.csv("rbcL_2.csv")
rbcL <- read.GenBank(rbcL_num$rbcL)
matk_num <-read.csv("matk.csv")
matk <- read.GenBank(matk_num$matk)
# writing them in fasta format with accession numbers
write.dna(matk, file = "matk.fasta", format = "fasta", append = FALSE)
write.dna(rbcL, file = "rbcL.fasta", format = "fasta", append = FALSE)
# reading them again
matk_seqinr <- read.fasta(file = "matk.fasta", seqtype = "DNA", as.string = TRUE, forceDNAtolower = FALSE)
rbcL_seqinr <- read.fasta(file = "rbcL.fasta", seqtype = "DNA", as.string = TRUE, forceDNAtolower = FALSE)
#saving with names instead of accession numbers (idk why we cannot do this with the previous steps, but whatever)
write.fasta(sequences = matk_seqinr, names = matk_num$speciesnames, file.out = "matk_sequences.fasta")
write.fasta(sequences = rbcL_seqinr, names = rbcL_num$speciesnames, file.out = "rbcL_sequences.fasta")
setwd(dir ="~/Desktop/Order-Wise trees/Arecales")
Arecales_rbcL <- read.csv("Arecales_rbcL.csv")
Arecales_rbcL_genbank_rbcL <- read.GenBank(Arecales_rbcL$rbcL)
write.dna(Arecales_rbcL_genbank_rbcL, file = "Arecales_rbcL.fasta", format = "fasta", append = FALSE)
Arecales_rbcL_seqinr <- read.fasta(file = "Arecales_rbcL.fasta", seqtype = "DNA", as.string = TRUE, forceDNAtolower = FALSE)
write.fasta(sequences = Arecales_rbcL_seqinr, names = Arecales_rbcL$speciesname, file.out = "Arecales_rbcL_sequences.fasta")
Arecales_trnH <- read.csv("Arecales_trnH.csv")
Arecales_trnH_genbank_trnH <- read.GenBank(Arecales_trnH$trnh_psba)
write.dna(Arecales_trnH_genbank_trnH, file = "Arecales_trnH.fasta", format = "fasta", append = FALSE)
Arecales_trnH_seqinr <- read.fasta(file = "Arecales_trnH.fasta", seqtype = "DNA", as.string = TRUE, forceDNAtolower = FALSE)
write.fasta(sequences = Arecales_trnH_seqinr, names = Arecales_trnH$speciesname, file.out = "Arecales_trnH_sequences.fasta")
Arecales_trnH <- read.csv("Arecales_trnH.csv")
Arecales_trnH_genbank_trnH <- read.GenBank(Arecales_trnH$trnh_psba)
write.dna(Arecales_trnH_genbank_trnH, file = "Arecales_trnH.fasta", format = "fasta", append = FALSE)
Arecales_trnH_seqinr <- read.fasta(file = "Arecales_trnH.fasta", seqtype = "DNA", as.string = TRUE, forceDNAtolower = FALSE)
write.fasta(sequences = Arecales_trnH_seqinr, names = Arecales_trnH$speciesname, file.out = "Arecales_trnH_sequences.fasta")
library(seqinr)
library(ape)
# reading sequences from file
setwd(dir ="~/Desktop/Files")
matk_num <-read.csv("matk.csv")
matk <- read.GenBank(matk_num$matk)
# writing them in fasta format with accession numbers
write.dna(matk, file = "matk.fasta", format = "fasta", append = FALSE)
# reading them again
matk_seqinr <- read.fasta(file = "matk.fasta", seqtype = "DNA", as.string = TRUE, forceDNAtolower = FALSE)
#saving with names instead of accession numbers (idk why we cannot do this with the previous steps, but whatever)
write.fasta(sequences = matk_seqinr, names = matk_num$speciesnames, file.out = "matk_sequences.fasta")
matk_num <-read.csv("matk.csv")
matk <- read.GenBank(matk_num$matk)
# writing them in fasta format with accession numbers
write.dna(matk, file = "matk.fasta", format = "fasta", append = FALSE)
# reading them again
matk_seqinr <- read.fasta(file = "matk.fasta", seqtype = "DNA", as.string = TRUE, forceDNAtolower = FALSE)
#saving with names instead of accession numbers (idk why we cannot do this with the previous steps, but whatever)
write.fasta(sequences = matk_seqinr, names = matk_num$speciesnames, file.out = "matk_sequences.fasta")
setwd(dir ="~/Desktop/Order-Wise trees/Asterales")
Asterales_rbcL <- read.csv("Asterales_rbcL.csv")
Asterales_rbcL_genbank_rbcL <- read.GenBank(Asterales_rbcL$rbcL)
write.dna(Asterales_rbcL_genbank_rbcL, file = "Asterales_rbcL.fasta", format = "fasta", append = FALSE)
Asterales_rbcL_seqinr <- read.fasta(file = "Asterales_rbcL.fasta", seqtype = "DNA", as.string = TRUE, forceDNAtolower = FALSE)
write.fasta(sequences = Asterales_rbcL_seqinr, names = Asterales_rbcL$speciesname, file.out = "Asterales_rbcL_sequences.fasta")
Asterales_matK <- read.csv("Asterales_matK.csv")
Asterales_matK_genbank_matK <- read.GenBank(Asterales_matK$matk)
write.dna(Asterales_matK_genbank_matK, file = "Asterales_matK.fasta", format = "fasta", append = FALSE)
Asterales_matK_seqinr <- read.fasta(file = "Asterales_matK.fasta", seqtype = "DNA", as.string = TRUE, forceDNAtolower = FALSE)
write.fasta(sequences = Asterales_matK_seqinr, names = Asterales_matK$speciesname, file.out = "Asterales_matK_sequences.fasta")
Asterales_trnH <- read.csv("Asterales_trnH.csv")
Asterales_trnH_genbank_trnH <- read.GenBank(Asterales_trnH$trnh_psba)
write.dna(Asterales_trnH_genbank_trnH, file = "Asterales_trnH.fasta", format = "fasta", append = FALSE)
Asterales_trnH_seqinr <- read.fasta(file = "Asterales_trnH.fasta", seqtype = "DNA", as.string = TRUE, forceDNAtolower = FALSE)
write.fasta(sequences = Asterales_trnH_seqinr, names = Asterales_trnH$speciesname, file.out = "Asterales_trnH_sequences.fasta")
